﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class FangPriceController : ControllerBase
    {
        public FangPriceController(FangPrice_BLL bll)
        {
            Bll = bll;
        }

        public FangPrice_BLL Bll { get; }

        /// <summary>
        /// 房价添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        [HttpPost("Add")]
        public IActionResult Add(FangPrice_Model m)
        {
            var m1= Bll.Add(m);
            return Ok(new
            {
                data = m1
            });
        }
        /// <summary>
        /// 房价列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("Show")]
        public IActionResult Show()
        {
            var m=Bll.Show();
            return Ok(new
            {
                data = m
            });
        }

    }
}
